﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master" AutoEventWireup="true" CodeBehind="MemberScoreLog.aspx.cs" Inherits="ZLCMS.Web.Wap.Member.MemberScoreLog" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title></title>
    <link href="../Shop/css/Membercenter.css" rel="stylesheet" type="text/css" />
    <script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
    <style type="text/css">
        .tibutext{text-align: center;font-size: 16px;line-height: 40px;color: #c5c5c5;display: block;}
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">
 <div data-role="page" class="IntegralRecord">
    <div data-role="header" class="Recordheader">
        <p><span class="fanhui" onclick="location.href='/Wap/Shop/MemberCenter.aspx'"></span>
            <span class="memberscorelogtitle"></span></p>
    </div>
    <div data-role="main">
        <ul class="integraul">
            <li></li>
       </ul>
        <div style="display:none">
            <button id="btnMore" style="width: 95%; margin-left: auto; margin-right: auto;">显示更多</button>
        </div>
    </div>
 </div>
<script type="text/javascript">
    $(function () {
        if ('<%=Request["kind"] %>' == 'growth') {
            $('.memberscorelogtitle').html('成长值记录')
            $('title').text('成长值记录')
        } else {
            $('.memberscorelogtitle').html('积分记录')
            $('title').text('积分记录')
        }
        queryData()
        $(window).scroll(function () {
            if ($(this).scrollTop() + $(window).height() + 20 >= $(document).height() && $(this).scrollTop() > 20) {
                //当前要加载的页码
                $('#btnMore').click();
            }
        });
    })
    function queryData() {
        var handler = $('.integraul').listviewHandler();

        var itemTemp = '<li>' +
                '<p>{REMARK}<span>+{SCORE}</span></p>' +
             '<p>{OPT_TIME}</p>' +
            '</li>';

        var pageSize = 15;
        handler.initialize({
            loaderBtn: $('#btnMore'), //加载数据按钮（点击加载下一页）
            emptyHtml: '<span class="tibutext">无记录</span>', //无记录时显示此html
            itemTemplate: itemTemp, //项模板
            pageIndex: 1, //页码（从1起算）
            pageSize: pageSize, //页大小
            totalCount: 999, //总记录数
            itemHandler: function (data, itemTemplate, container) {//数据各项处理
                if (data.SCORE < 0) {
                    itemTemplate = '<li>' + '<p>{REMARK}<span>{SCORE}</span></p>' + '<p>{OPT_TIME}</p>' + '</li>';
                }
                return itemTemplate.format(data);
            },
            afterHandleResult: function (result, totalCount, container) {
            },
            command: 'Member.LoadScoreLogList',
            parameter: { Kind: '<%=Request["kind"] %>' }
        });
        handler.nextPage();
    }
   
</script>
</asp:Content>
